<?php
namespace app\common\validate;

use think\Validate;

class MessageValidate extends Validate
{
    protected $rule =   [
        'name'  => 'require|max:25',
        'title' => 'require|max:200',
		'sort'	=> 'require|number'
    ];
    
    protected $message  =   [
        'name.require' => '名称必须',
        'name.max'     => '名称最多不能超过25个字符',
        'name.unique'     => '名称重复',
        'title.require'=> '描述必须填写',
        'title.max'  => '描述最多不能超过200个字符',
		'sort.require' => '必须输入排序',
		'sort.number' => '必须输入数字'
    ];
    
    protected $scene = [
        'add'  =>  ['name','title','lsort'],
        'edit'  =>  ['name','title','lsort'],
		'sort' => ['lsort']
    ];
}
